package com.xzt.demospringsecurity.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;

@Controller
public class TestController {

    @RequestMapping("/test")
    public String test1(Model model) {

        model.addAttribute("msg","hello,springboot");
        return "test";
    }

    @RequestMapping("/test2")
    public String test2(Map<String,String> map){
        map.put("msg", "<h1>hello xzt</h1>");

        return "test";
    }

}
